package com.health.circle.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.health.circle.domain.vo.PatientCircleVo;
import com.health.circle.mapper.DepartmentMapper;
import com.health.circle.mapper.IPatientCircleMapper;
import com.health.circle.service.IPatientCircleService;
import com.health.common.core.po.DepartmentPo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author : Zzs
 * @description :
 * @createDate : 2024/12/18 下午7:31
 */
@Service
public class IPatientCircleServiceImpl extends ServiceImpl<IPatientCircleMapper, PatientCircleVo> implements IPatientCircleService {

    @Autowired
    private IPatientCircleMapper patientCircleMapper;

    /**
     * 查询病友圈信息
     * @param departmentId
     * @return
     */
    @Override
    public List<PatientCircleVo> findByDepartmentId(Integer departmentId) {

        QueryWrapper<PatientCircleVo> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("department_id", departmentId);

        List<PatientCircleVo> list = patientCircleMapper.selectList(queryWrapper);

        return list;
    }

    /**
     * 查询病状详情
     * @param id
     * @return
     */
    @Override
    public PatientCircleVo getDetailsByid(Integer id) {
        PatientCircleVo patientCircleVo = patientCircleMapper.getDetailsByid(id);
        return patientCircleVo;
    }
}

